using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Business;
using Entity;

public partial class EmployeePage_EmpLogin : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        lblCheck.Text = "";
        eEmployee employee = bEmployee.employeeLogin(txtUsername.Text, txtPassword.Text);
        if (employee != null)
        {
            Session["employee"] = employee;
            if (employee.typeID == 1)
            {
                Response.Redirect("AdminHomePage.aspx");
            }
            else if (employee.typeID == 2)
            {
                Response.Redirect("AccountDepartmentHomePage.aspx");
            }
            else if (employee.typeID == 3)
            {
                Response.Redirect("TechnicalHomePage.aspx");
            }
            else if (employee.typeID == 4)
            {
                Response.Redirect("RetailEmployeeHomePage.aspx");
            }
        }
        else
        {
            lblCheck.Text = "Login Failed! Invalid Username or Password";
        }
    }
}
